import { UserInfo } from "src/common/model";
import { RoleEntity } from "src/entity";
import { WsCommonException } from "src/exception";

export enum Emitter {
    CLOSE_WS_BY_USER_ID = "close.ws.by.user.id",
    UPDATE_STATUS = "update.status",
}

export interface EmitterFunc {
    emitAsync(event: Emitter.CLOSE_WS_BY_USER_ID, id: number, token: string, error: WsCommonException): Promise<void[]>;
    emitAsync(event: Emitter.UPDATE_STATUS, type: "update.user", ...ids: UserInfo["id"][]): Promise<void[]>;
    emitAsync(event: Emitter.UPDATE_STATUS, type: "remove.user", ...ids: UserInfo["id"][]): Promise<void[]>;
    emitAsync(event: Emitter.UPDATE_STATUS, type: "update.role", ...role: RoleEntity[]): Promise<void[]>;
    emitAsync(event: Emitter.UPDATE_STATUS, type: "remove.role", ...id: number[]): Promise<void[]>;

}
